Prime Normal Form and Equivalence of Simple Grammars

نویسندگان

  • Cédric Bastien
  • Jurek Czyzowicz
  • Wojciech Fraczak
  • Wojciech Rytter
چکیده

A prefix-free language is a prime if it cannot be decomposed into a concatenation of two prefix-free languages. We show that we can check in polynomial time if a language generated by a simple contextfree grammar is a prime. Our algorithm computes a canonical representation of a simple language, converting its arbitrary simple grammar into Prime Normal Form (PNF); a simple grammar is in PNF if all its nonterminals define primes. We also improve the complexity of testing the equivalence of simple grammars. The best previously known algorithm for this problem worked in O(n) time. We improve it to O(n log n) and O(n polylog v) deterministic time, and O(n polylogn) randomized time, where n is the total size of the grammars involved, and v is the length of a shortest string derivable from a nonterminal, maximized over all nonterminals. Our improvement is based on a version of Caucal’s algorithm from [1].

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Structure Preserving Transformations on Non-Left-Recursive Grammars (Preliminary Version)

1. INTROOUCTION ANO PRELIMINARIES If a context-free grammar is transformed to another context-free grammar in most of the cases it is quite obvious to demand weak equivalence for these two grammars. Transformations on context-free grammars can be defined for several reasons. Oepen-dent on these reasons one may be interested in stronger relations of grammatical similarity. Instead of arbitrary c...

متن کامل

On fuzzy multiset regular grammars

The main goal of this paper is to introduce and study fuzzy multiset regular grammar to show that fuzzy multiset finite automata and fuzzy multiset regular grammars are equivalent. We also study fuzzy multiset linear grammars and fuzzy multiset regular grammars in normal form. Furthermore, we show the equivalence of fuzzy multiset regular grammars, fuzzy multiset left linear grammars, fuzzy mul...

متن کامل

PreRkTAG: Prediction of RNA Knotted Structures Using Tree Adjoining Grammars

Background: RNA molecules play many important regulatory, catalytic and structural <span style="font-variant: normal; font-style: norma...

متن کامل

Formal grammars Lectures ??–??. Linear grammars and trellis automata

The linear case of context-free, conjunctive and Boolean grammars. Trellis automata. Examples. Equivalence of grammars and automata. 1 Linear Boolean grammars Definition 1. A Boolean grammar G = (Σ, N, P, S) is said to be linear if every rule A→ α1& . . .&αm&¬β1& . . .&¬βn, has αi, βj ∈ Σ∗ ∪ (Σ ∪N)∗. If a linear Boolean grammar is conjunctive (context-free), it is called a linear conjunctive (l...

متن کامل

Eecient Normal-form Parsing for Combinatory Categorial Grammar

Under categorial grammars that have powerful rules like composition, a simple n-word sentence can have exponentially many parses. Generating all parses is inee-cient and obscures whatever true semantic ambiguities are in the input. This paper addresses the problem for a fairly general form of Combinatory Categorial Grammar, by means of an eecient, correct, and easy to implement normal-form pars...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Theor. Comput. Sci.

دوره 363  شماره 

صفحات  -

تاریخ انتشار 2005